// ================================START====================================
// Template generated from		FRAMEWORKIVY CODE GENERATOR
// Generator Version:			<1.0.0.0>
// Template Creation Time:		<Thursday, 26 May, 2016   12:32:16 AM>
// Template Modification Time:	<Monday, 23 May, 2016   11:22:57 PM>
// Code Generation Time:		<Thursday, 26 May, 2016   12:52:16 AM>
// Workstation ID:				<PRAVESH>
// Current system User ID:		<pravesh kr>
// Entity/Table Name:			<User>
// ModuleName:			        <UserManagement>
// Description:					<CSharp Class For Entity Dao Unit Test>
// Template File:				<IvyGodeGenDefaultTemplate V1.1.xml>

// Please modify the generated code as per requirement.
// This code generator is just to speed up the stereo type codes
// Complex logic needs to be modified manually.

// This block of comments will not be included in
// the definition of the procedure.
// =========================================================================

using System;

//This Class specific System namespaces
using Microsoft.VisualStudio.TestTools.UnitTesting;

//This Class Specific IvyFramework namespaces
using Ivy.Common.Framework.Base;
using Ivy.Common.Framework.DataAccess;
using Ivy.Common.Framework.GeneralUtility;

using Ivy.UserManagement.Entity;
using Ivy.UserManagement.DataAccess;

namespace Ivy.UserManagement.UnitTest
{
    [TestClass]
    public class UserDaoUnitTest
    {
        [TestMethod]
        public void UserInsertTestMethod()
        {
            User _tempUser = new User();
            UserDao _UserDao = new UserDao();

            //Auto Generated attribute should not be supplied from outside.

            //Foreign Key attribute should have valid values from their respective parent tables/entities
            _tempUser.UserPersonKey = 9999; //Not Unique Key
            _tempUser.UserLoginId = "TEST UserLoginId Unique_" + StringUtility.GenerateRandomString(6); //Unique Key
            _tempUser.UserPassword = "TEST UserPassword Not Unique" ;
            _tempUser.UserLoginIdType = 9999; //Not Unique Key
            _tempUser.UserForgotPasswordQuestion = "TEST UserForgotPasswordQuestion Not Unique" ;
            _tempUser.UserForgotPasswordAnswer = "TEST UserForgotPasswordAnswer Not Unique" ;

            _tempUser.Sys_CreatedByID = "1";
            _tempUser.Sys_DeleteType = DeleteType.SoftDeleteOnly;
            _tempUser.Sys_IsDeleted = false;
            _tempUser.Sys_OrganizationID = -1;

            Assert.IsTrue(_UserDao.Insert(_tempUser));
        }

        //[TestMethod]
        //public void UserUpdateTestMethod()
        //{
        //    User _tempUser = new User();
        //    UserDao _UserDao = new UserDao();

        //    //Please edit and provide a valid value for GetByPrimaryKey() parameter
        //    _tempUser = _UserDao.GetByPrimaryKey(int_UserPersonKey); 

        //    _tempUser.UserLoginId = "TEST UserLoginId Unique_" + StringUtility.GenerateRandomString(6); //Unique Key
        //    _tempUser.UserPassword = "TEST UserPassword Not Unique" ;
        //    _tempUser.UserLoginIdType = 9999; //Not Unique Key
        //    _tempUser.UserForgotPasswordQuestion = "TEST UserForgotPasswordQuestion Not Unique" ;
        //    _tempUser.UserForgotPasswordAnswer = "TEST UserForgotPasswordAnswer Not Unique" ;

        //    _tempUser.Sys_ModifiedByID = "1";

        //    Assert.IsTrue(_UserDao.Update(_tempUser));
        //}

    }
}


